// 删除文章
const db = require("../lib/db")

function deleteArticle(values){
    return new Promise((resolve , reject) =>{
        let sql = "delete from article where _id = '" + values + "'";
        db.querySql(sql).then( data => {
            if(data.length == 0){
                // 删除失败
                resolve(400)
            }else{
                // 删除成功
                resolve(200)
            }
        })        
    })
}
// 导出
module.exports = deleteArticle
